package org.zhao.nettydemos.lab09;

import java.util.Timer;
import java.util.TimerTask;

/**
 * @Auther: xiaohui.zhao
 * @Date: 2021/9/17 17:05
 * @Description: 测试Timer
 */
public class TimerTest {

    public static void main(String[] args) throws InterruptedException {
        Timer timer = new Timer();
        timer.scheduleAtFixedRate(new TimerTask() {
            @Override
            public void run() {
                System.out.println("测试timer类");
            }
        },1000,1000);

        Thread.sleep(10000);
        timer.cancel();
    }

}